package com.ruoyi.personnel.salary.transfer.service;

import com.ruoyi.personnel.salary.transfer.domain.TransferDto;
import com.ruoyi.personnel.salary.transfer.domain.TransferCond;
import com.ruoyi.personnel.salary.transfer.domain.TransferDomain;
import com.ruoyi.personnel.salary.transfer.mapper.TransferMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 工资转账记录
 * 业务处理层
 */
@Service
public class TransferServiceImpl implements ITransferService {
    @Autowired
    private TransferMapper transferMapper;

    /**
     * 根据搜索条件所有查询工资转账记录
     * @param cond 搜索条件
     * @return
     */
    @Override
    public List<TransferDto> selectTransferList(TransferCond cond) {
        return transferMapper.selectTransferList(cond);
    }

    /**
     * 根据员工编号搜索具体的工资转账记录
     * @param staffId
     * @return
     */
    @Override
    public TransferDto selectTransferById(String staffId) {
        return transferMapper.selectTransferById(staffId);
    }

    /**
     * 新增工资转账记录
     * @param transfer
     * @return
     */
    @Override
    public int insertTransfer(TransferDomain transfer) {
        return transferMapper.insertTransfer(transfer);
    }

    /**
     * 修改工资转账记录
     * @param transfer
     * @return
     */
    @Override
    public int updateTransfer(TransferDomain transfer) {
        return transferMapper.updateTransfer(transfer);
    }

    /**
     * 删除工资转账记录
     * 仅修改删除标志
     * @param transfer
     * @return
     */
    @Override
    public int updateTransferDeleteFlag(TransferDomain transfer) {
        return transferMapper.updateTransferDeleteFlag(transfer);
    }
}
